#! /bin/bash
## author:XueXianqi

echo `date '+%Y-%m-%d %H:%M:%S'` '正在为您开启sshd服务'
sudo apt-get install openssh-server -y
sudo sed -i 's/#Port 22/Port 22/' /etc/ssh/sshd_config
sudo sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config
sudo sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sudo sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
sudo /etc/init.d/ssh start
echo `date '+%Y-%m-%d %H:%M:%S'` 'sshd服务成功开启'
